<!--  -->
<template>
  <div class="">
    <div class="myMoney classify">
      <div class="recharge one">
        <div class="money">
          总用户数
          <!-- <span class="biao1">年</span> -->
        </div>
        <div class="wire"></div>
        <div class="datapresentation">
          <span>{{ allUserCnt || 0 }}人</span>
        </div>
      </div>
      <div class="recharge tow">
        <div class="money">
          昨日新增用户
          <!-- <span class="biao2">日</span> -->
        </div>
        <div class="wire"></div>
        <div class="datapresentation">
          <div>
            <span>{{ yesterdayJoinCnt || 0 }}人</span>
          </div>
        </div>
      </div>
      <div class="recharge three">
        <div class="money">
          今日新增用户数
          <!-- <span class="biao3">日</span> -->
        </div>
        <div class="wire"></div>
        <div class="datapresentation">
          <span>{{ todayJoinCnt || 0 }}人</span>
        </div>
      </div>
    </div>

    <div class="block searchBox">
      <el-col :span="24" class="operation">
        <div class="block">
          <el-input
            v-model="inputName"
            placeholder="请输入账号名"
            class="userNameField"
          ></el-input>
          <el-date-picker
            value-format="yyyy-MM-dd"
            class="timetable"
            v-model="searchTime"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            @change="timeChange"
          >
          </el-date-picker>
          <el-button type="primary" @click="search">搜索</el-button>
          <el-button type="primary" @click="AddRegularUsers = true"
            >添加用户</el-button
          >
        </div>
      </el-col>
    </div>

    <template>
      <div class="sort">
        <el-radio-group v-model="sort" @change="cutSort" :size="sortsize">
          <el-radio-button label="">默认排序</el-radio-button>
          <el-radio-button label="topUpMost">充值最多</el-radio-button>
          <el-radio-button label="consumption">消费最多</el-radio-button>
          <el-radio-button label="balance">余额最多</el-radio-button>
        </el-radio-group>
      </div>
    </template>
    <el-col :span="24" class="exhibition">
      <div  class="Thelistshows">
        <el-table
          :data="listData"
          stripe
          style="width: 100%"
          v-if="this.$store.state.user.power == 1"
        >
          <el-table-column   label="序号" min-width="8%" type="index">
          </el-table-column>
          <el-table-column prop="username" label="账户名" min-width="15%">
            <template slot-scope="scope" >{{scope.row.username.slice(0,11) }}</template>
          </el-table-column>
          <el-table-column prop="pay_all" label="账户充值" min-width="10%">
            <template slot-scope="scope" >{{scope.row.pay_all }}</template>
          </el-table-column>
          <el-table-column prop="consume_all" label="账户消费" min-width="10%">
            <template slot-scope="scope" >{{scope.row.consume_all }}</template>
          </el-table-column>
          <el-table-column prop="balance" label="账户余额" min-width="10%">
             <template slot-scope="scope" >{{scope.row.balance }}</template>
          </el-table-column>
          <el-table-column
            prop="create_time"
            label="创建时间"
            min-width="25%"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.create_time.replace('T',' ').slice(0,19) }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="is_active" label="状态" min-width="10%">
            <template slot-scope="scope">
              <div v-if="scope.row.is_active == false" class="underLine">
                <span class="blockUp">已停用</span>
              </div>
              <div v-else>
                <span class="startUsing">
                  已启用
                </span>
              </div>
            </template>
          </el-table-column>
          <el-table-column  label="操作" min-width="20%">
            <template slot-scope="operate">
              <el-tooltip
                class="item"
                effect="dark"
                :content="operate.row.is_active ? '停用' : '启用'"
                placement="top-start"
              >
              <!-- 启用 -->
                <i
                  class="el-icon-video-play ActionIcon"
                  @click="
                    startUsing(operate.row.is_active, operate.row.username,operate.row.id)
                  "
                  v-if="operate.row.is_active == false"
                ></i>
                <!-- 停用 -->
                <i
                  class="el-icon-remove-outline ActionIcon"
                  @click="
                    forbidden(operate.row.is_active, operate.row.username,operate.row.id)
                  "
                  v-else
                ></i>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="dark"
                content="权益"
                placement="top-start"
              >
                <span class="bianjiquanxian1">
                  <el-button
                    class="bianjiquanxian"
                    type="text"
                    @click="
                      EditButton(
                        operate.row.id
                      )
                    "
                    ><i class="el-icon-edit-outline ActionIcon xiaoshi"></i
                  ></el-button>
                </span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="dark"
                content="查看"
                placement="top-start"
              >
                <router-link
                  :to="{
                    name: '10-2',
                    query: { keyword: operate.row.username }
                  }"
                >
                  <el-button type="text"
                    ><i class="el-icon-postcard ActionIcon"></i
                  ></el-button>
                </router-link>
              </el-tooltip>
              <router-view> </router-view>
            </template>

            <template>
              <i class="el-icon-edit-outline ActionIcon"></i>
              <i class="el-icon-postcard ActionIcon"></i>
            </template>
          </el-table-column>
          <template slot="empty">
            <img class="data-pic" src="@/assets/abbdd35b6e88fafd24e25f2d37450ad.png" alt="" />
          </template>
        </el-table>

          <!-- 权限等于2的显示 -->

        <el-table
          :data="listData"
          stripe
          style="width: 100%"
          v-if="this.$store.state.user.power == 2"
        >
          <el-table-column type="index" label="序号" min-width="8%">
          </el-table-column>
          <el-table-column prop="username" label="账户名" min-width="15%">
          </el-table-column>
          <el-table-column prop="pay_all" label="账户充值" min-width="10%">
            <template slot-scope="scope">{{
              scope.row.pay_all
            }}</template>
          </el-table-column>
          <el-table-column prop="consume_all" label="账户消费" min-width="10%">
            <template slot-scope="scope">{{
              scope.row.consume_all
            }}</template>
          </el-table-column>
          <el-table-column prop="balance" label="账户余额" min-width="10%">
            <template slot-scope="scope">{{
              scope.row.balance
            }}</template>
          </el-table-column>
          <el-table-column
            prop="create_time"
            label="创建时间"
            min-width="25%"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.create_time }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="is_active" label="状态" min-width="10%">
            <template slot-scope="scope">
              <div v-if="scope.row.is_active == false" class="underLine">
                <span class="blockUp">已停用</span>
              </div>
              <div v-else class="startUsing">已启用</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="操作"
            min-width="20%"
            class="address"
          >
            <template slot-scope="operate">
              <span v-if="operate.row.is_active == false">
                <i
                  class="el-icon-video-play ActionIcon"
                  @click="
                    startUsing(operate.row.is_active, operate.row.username,operate.row.id)
                  "
                ></i>
              </span>
              <span v-if="operate.row.is_active == true">
                <i
                  class="el-icon-remove-outline ActionIcon"
                  @click="
                    forbidden(operate.row.is_active, operate.row.username,operate.row.id)
                  "
                ></i>
              </span>
              <router-link
                :to="{
                  name: '10-2',
                  query: { keyword: operate.row.username },
                }"
              >
                <el-button type="text"
                  ><i class="el-icon-postcard ActionIcon"></i
                ></el-button>
              </router-link>
              <router-view> </router-view>
            </template>

            <template>
              <i class="el-icon-edit-outline ActionIcon"></i>
              <i class="el-icon-postcard ActionIcon"></i>
            </template>
          </el-table-column>
          <template slot="empty">
            <img class="data-pic" src="@/assets/BGT.png" alt="" />
          </template>
        </el-table>
      </div>

        <!-- 移动端 -->
        <div class="Foldingbar">
        <el-collapse accordion v-if="this.$store.state.user.power == 1">
          <el-collapse-item v-for="item in listData" :key="item.id">
            <template slot="title">
              <span>用户名: &nbsp; {{ item.username.slice(0,11) }}</span>
              <span style="margin-left: 58px">
                <span v-if="item.is_active == false" class="blockUp">
                  状态: &nbsp;已禁用
                </span>
                <span v-else class="startUsing">
                  状态: &nbsp;已启用
                </span>
              </span>
            </template>
            <div>账户充值: &nbsp;{{ item.pay_all}}</div>
            <div>账户消费: &nbsp;{{ item.consume_all }}</div>
            <div>账户余额: &nbsp;{{ item.balance}}</div>
            <div>
              创建时间: &nbsp;
              <template>
                <span>{{ item.create_time}}</span>
              </template>
            </div>
            <div class="operatingButton">
              <div v-if="item.is_active == false">
                操作: &nbsp;
                <i
                  class="el-icon-video-play ActionIcon"
                  @click="startUsing(item.is_active, item.username,item.id)"
                ></i>
                <el-button
                  id="xiaoshi"
                  type="text"
                  @click="
                    EditButton(item.id)
                  "
                  ><i class="el-icon-edit-outline ActionIcon"></i
                ></el-button>
                <router-link :to="{
                  name:'10-2',
                  query:{keyword:item.username}
                }">
                  <el-button type="text"
                    ><i class="el-icon-postcard ActionIcon"></i
                  ></el-button>
                </router-link>
                <router-view> </router-view>
              </div>
              <div v-else>
                操作:
                <i
                  class="el-icon-remove-outline ActionIcon"
                  @click="forbidden(item.is_active, item.username,item.id)"
                ></i>
                <!-- <el-button
                  type="text"
                  @click="
                    EditButton(item.yonhuming, item.fanyongbili, item.quanxian)
                  "
                  ><i class="el-icon-edit-outline ActionIcon"></i
                ></el-button> -->
                <router-link to="DetailPage">
                  <el-button type="text"
                    ><i class="el-icon-postcard ActionIcon"></i
                  ></el-button>
                </router-link>
                <router-view> </router-view>
              </div>
            </div>
          </el-collapse-item>
        </el-collapse>
        <el-collapse accordio v-if="this.$store.state.user.power == 2">
          <el-collapse-item v-for="item in tableData" :key="item.id">
            <template slot="title">
              <span>用户名: &nbsp;{{ item.username }}</span>
              <span style="margin-left: 58px">
                <span v-if="item.is_active == false" class="blockUp">
                  状态: &nbsp;已禁用
                </span>
                <span v-else class="startUsing">
                  状态: &nbsp;已启用
                </span>
              </span>
            </template>
            <div>账户充值: &nbsp;{{ item.pay_all}}</div>
            <div>账户消费: &nbsp;{{ item.consume_all}}</div>
            <div>账户余额: &nbsp;{{ item.balance}}</div>
            <div>
              创建时间:
              <template>
                <span>{{ item.create_time}}</span>
              </template>
            </div>
            <div class="operatingButton">
              <div>
                操作: &nbsp;
                <i
                  v-if="item.is_active == false"
                  class="el-icon-video-play ActionIcon"
                  @click="startUsing(item.is_active, item.username)"
                ></i>
                <i
                  v-else
                  class="el-icon-remove-outline ActionIcon"
                  @click="forbidden(item.is_active, item.username)"
                ></i>
                <router-link to="DetailPage">
                  <el-button type="text"
                    ><i class="el-icon-postcard ActionIcon"></i
                  ></el-button>
                </router-link>
                <router-view> </router-view>
              </div>
              <!-- <div >
								操作:

								<el-button type="text" @click="EditButton(item.yonhuming,item.fanyongbili,item.quanxian)"><i class="el-icon-edit-outline ActionIcon"></i></el-button>
								<router-link to="DetailPage">
									<el-button type="text"><i class="el-icon-postcard ActionIcon"></i></el-button>
								</router-link>
								<router-view>
								</router-view>
							</div> -->
            </div>
          </el-collapse-item>
        </el-collapse>
      </div>



      <div class="paging">
        <!-- 分页 -->
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="currentPage4"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pagingNum"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
      <!-- 权益部分 -->
      <el-dialog
        title="编辑权益"
        :visible.sync="centerDialogVisible1"
        width="350px"
      >
        <div class="userNameptbox">
          <span> 用户名 </span>
          <el-input
            v-model="qxyhm"
            placeholder="请输入内容"
            disabled
          ></el-input>
        </div>
        <div class="userLevelbox">
          <span>修改级别</span>
          <el-input placeholder="代理用户" disabled></el-input>
          <!-- <el-select v-model="userLevel" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select> -->
        </div>
        <div class="CommissionRatiobox">
          <span> 返佣比例 </span>
          <el-input
            v-model="CommissionRatio"
            placeholder="请输入内容"
            oninput="value=value.replace(/[^\d]/g,'')"
          ></el-input>
        </div>
        <div class="CommissionRatiobox">
          <div class="tishiyu">
            若想要将普通用户升级为代理用户，请在返佣比例框内填入整数
          </div>
        </div>
        <div class="ptyhan">
          <el-button @click="centerDialogVisible1 = false">取 消</el-button>
          <el-button type="primary" @click="CommissionRatioqd">确 定</el-button>
        </div>
      </el-dialog>
      <el-dialog
        title="添加普通用户"
        :visible.sync="AddRegularUsers"
        width="350px"
      >
        <div class="userNameptbox">
          <span> 账号名称 </span>
          <el-input
            type="input"
            v-model="addCommon.username"
            placeholder="用户名必须为11位手机号"
          ></el-input>
        </div>
        <div class="CommissionRatiobox">
          <span> 用户密码 </span>
          <el-input
            v-model="addCommon.password"
            placeholder="密码长度不能小于6个字符"
            show-password
          ></el-input>
        </div>
        <div class="CommissionRatiobox">
          <span> 确认密码 </span>
          <el-input
            v-model="addCommon.confirmPassword"
            placeholder="密码长度不能小于6个字符"
            show-password
          ></el-input>
        </div>
        <div class="ptyhan">
          <el-button @click="AddRegularUsers = false">取 消</el-button>
          <el-button type="primary" @click="addUsers()">确 定</el-button>
        </div>
      </el-dialog>
    </el-col>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import moment, { duration, locales } from "moment";
import { mapState } from "vuex";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      begin_time:'',
      end_time:'',
      pagingNum:10,
      usernameID:'',
      inputName:'',
      page_index:1,       //第几页
      page_cnt:10,        //一页几条
      sort_by:0,          //排序规则
      listData: [],          //表格数据
      yesterdayJoinCnt: '',  //昨日新增
      allUserCnt: '',        //总用户
      todayJoinCnt: '',      //今日新增
      sort: "",
      value1: "",
      value2: "",
      tableData: [],
      kaishishu: 0,
      jieshushu: 10,
      currentPage4: 1,
      username: "",
      searchTime: [],
      newVal: "",
      oldVal: "",
      total: 0,
      catalog: 10,
      zuorixingzen: 0,
      jinrixinzen: 0,
      jinrixinzen: 0,
      zongrenshu: 0,
      zhuangtai1: "",
      userNamept: "",
      CommissionRatio: "",
      userLevel: "",
      centerDialogVisible1: false,
      AddRegularUsers: false,
      qxyhm: "",
      //添加普通用户
      addCommon: {
        username: '',            //用户名
        password: '',            //密码
        confirmPassword: ''      //重复确认密码
      },
      // yonhuming1: "",
      // mima: "",
      // chongfumima: "",
      options: [
        {
          value: "0",
          label: "普通用户"
        },
        {
          value: "2",
          label: "代理用户"
        }
      ],
      value: "",
      sortvalue: "",
      loding: false,
      sortsize: ''
    };
  },
  // filters: {
  //   numFilter(value) {
  //     let val = ''
  //     if (!isNaN(value) && value != '') {
  //       if (value % 1 == 0 && value != 0) {//整数
  //         val = value + ".00"
  //       }
  //       else if (value == 0) {
  //         val = '0'
  //       }
  //       else {//小数
  //         val = parseFloat(value).toFixed(2)
  //       }
  //     } else {
  //       val = '0'
  //     }
  //     return val
  //   }
  // },
  //监听属性 类似于data概念
  computed: {
    // ...mapState(["user"])
  },
  //监控data中的数据变化
  watch: {
    // searchTime(newVal, oldVal) {
    //   if (newVal == null) {
    //     this.searchTime = [];
    //   }
    // }
  },
  //方法集合
  methods: {
    cutSort(){
      //充值最多
      if(this.sort==='topUpMost'){
        this.sort_by=1,
        this.Update()
      }
      //消费最多
      if(this.sort==='consumption'){
        this.sort_by=2,
        this.Update()
      }
      //余额最多
      if(this.sort==='balance'){
        this.sort_by=3,
        this.Update()
      }
      //默认排序
      if(this.sort===''){
        this.sort_by=0,
        this.Update()

      }
    },
    // sortClick(tab, index) {},
    // handleEdit(index, row) {
    //    console.log(index, row);
    // },
    // handleDelete(index, row) {
    //    console.log(index, row);
    // },
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then(_ => {
          done();
        })
        .catch(_ => { });
    },
    handleClose1(done) {
      this.$confirm("确认关闭？")
        .then(_ => {
          done();
        })
        .catch(_ => { });
    },
    //分页每页多少
    async handleSizeChange(val) {
      console.log(val)
      this.page_cnt=val,
      this.page_index=1
      this.sort_by=0;
      this.Update();

    },
    handleCurrentChange(val) {
      console.log('点击了'+val)
      this.page_index=val;
      this.page_cnt=this.page_cnt
      this.sort_by=0;
      this.Update();
    },
    //启用按钮操作
    startUsing(is_active, username,id) {
      this.$confirm("此操作将启用该用户, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: 'myClass'
      })
        .then(()=>{
          this.id=id;
          this.is_active=!is_active;
          this.username=username;
          this.operate();
          this.$message({
            type: "success",
            message: "启用成功!"
          });
        })
        .catch(()=>{
          this.$message({
            type: "info",
            message: "已取消启动!"
          })
        })
    },

    // 停用按钮操作
    forbidden(is_active, username,id) {
      this.$confirm("此操作将停用该用户, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.id=id;
          this.is_active = !is_active;
          this.username = username;
          this.operate();
          this.$message({
            type: "success",
            message: "停用成功!"
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消停用!"
          });
        });
    },
    // 启用和停用接口
    async operate() {
      const [err, res] = await this.$http.request({
        url: "/activeUser",
        method: "POST",
        data: {
          username: this.username,
          is_active: this.is_active,
          user_id:this.id,
        }
      });

      if (err) return;
      console.log(res)
      this.Update();
    },
    //权益
    EditButton(id) {
      this.usernameID=id;
      console.log(this.usernameID)
      this.centerDialogVisible1 = true;
    },
    async CommissionRatioqd(yonhuming) {
      if (this.CommissionRatio == 0) {
        this.$message({
          showClose: true,
          message: "返佣比例需要大于0",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.CommissionRatio > 20) {
        this.$message({
          showClose: true,
          message: "返佣比例不能超过百分之20",
          type: "error",
          duration: 1800
        });
        return;
      }
      this.centerDialogVisible1 = false;

      this.shiyan();
      this.Update();
    },
    //权益接口
    async shiyan() {
      const [err, res] = await this.$http.request({
        url: "/changeBrokerage",
        method: "POST",
        data: {
         user_id:this.usernameID,
         brokerage:this.CommissionRatio
        }
      });
      if (err) return;
      if(res.data.result){
        this.$message({
        message: "修改成功",
        type: "success"
      });
      }
      console.log(res.data.result)
      this.Update()
    },
    async Update() {
      let consume={
        sort_by:this.sort_by,
        page_index:this.page_index,
        page_cnt:this.page_cnt,
        begin_time:this.begin_time,
        end_time:this.end_time,
        account_name:this.account_name,
      }

      // this.sort ? (data.paixu = this.sort) : null;
      // if(this.searchTime.length>0){
      //   data.kaishishijian=this.$moment(this.searchTime[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
      //   data.jieshushijian=this.$moment(this.searchTime[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
      // }

      //普通用户接口
      const [err, res] = await this.$http.request({
        url: "/selfSimpleUser",
        method: "GET",
        data: consume
      });
      if (err) return;
      console.log(res.data.data);
        this.yesterdayJoinCnt = res.data.data.yesterdayJoinCnt,
        this.allUserCnt = res.data.data.allUserCnt,
        this.todayJoinCnt = res.data.data.todayJoinCnt
        this.listData=res.data.data.allSimpleUser
        this.total=res.data.data.data_cnt
    },
    //验证
    async addUsers() {
      if (this.addCommon.username == "") {
        this.$message({
          showClose: true,
          message: "账号名称不能为空",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (!/^1[34578]\d{9}$/.test(this.addCommon.username)) {
        this.$message({
          showClose: true,
          message: "请填写正确的手机号",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.addCommon.password == "") {
        this.$message({
          showClose: true,
          message: "用户密码不能为空",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.addCommon.password.length < "6") {
        this.$message({
          showClose: true,
          message: "用户密码小于6位数",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.addCommon.confirmPassword == "") {
        this.$message({
          showClose: true,
          message: "确认密码不能为空",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.addCommon.confirmPassword.length < "6") {
        this.$message({
          showClose: true,
          message: "确认密码小于6位数",
          type: "error",
          duration: 1800
        });
        return;
      }
      if (this.addCommon.confirmPassword !== this.addCommon.password) {
        this.$message({
          showClose: true,
          message: "2次密码不一样",
          type: "error",
          duration: 1800
        });
        return;
      }
      this.addUsers1();
    },
    //添加用户接口
    async addUsers1() {
      const [err, res] = await this.$http.request({
        url: "/addSimpleUser",
        method: "POST",
        data: this.addCommon
      });
      console.log(res)
      if (err) return;
      if (res.data.result === 1) {
        this.$message({
          showClose: true,
          message: "添加用户成功",
          type: "success",
          duration: 1800
        });
      }
      this.addCommon.confirmPassword='',
      this.addCommon.password='',
      this.addCommon.username='',
      // if (res.data.zhuangtai == "chenggong") {
      //   this.AddRegularUsers = false;
      //   this.$message({
      //     showClose: true,
      //     message: "添加用户成功",
      //     type: "success",
      //     duration: 1800
      //   });
      // }
      // this.fanhuizhuangtai = res.data.zhuangtai;
      // if (this.fanhuizhuangtai == "shibai") {
      //   this.yonghumingchunzai = res.data.tishi.yonhuming[0];
      //   if (this.yonghumingchunzai == "用户名已存在") {
      //     this.$message({
      //       showClose: true,
      //       message: "用户名已经存在",
      //       type: "error",
      //       duration: 1800
      //     });
      //     return;
      //   }
      // }
      this.AddRegularUsers = false;
      this.Update();
    },
    timeChange(time) {
      // console.log(time)
      if (time == null) {
        this.searchTime = [];
      } else {
        this.searchTime = [time[0], time[1]];
      }
    },
    //点击搜索
    search() {
      console.log(this.searchTime)
      this.begin_time=this.searchTime[0],
      this.end_time=this.searchTime[1],
      this.account_name=this.inputName
      console.log(this.begin_time,this.end_time)
      this.Update();
      // console.log(this.yeshu)
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    if (navigator.userAgent.match(/(iPhone|iPad|Android|ios)/i)) {
      this.sortsize = 'small'
    } else {
      this.sortsize = 'medium'
    }
    this.Update();
    this.timeChange();
    // console.log(this.$store.state.user)
    // console.log(this.$store.state.user.quanxian)
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() { },
  beforeCreate() { }, //生命周期 - 创建之前
  beforeMount() { }, //生命周期 - 挂载之前
  beforeUpdate() { }, //生命周期 - 更新之前
  updated() { }, //生命周期 - 更新之后
  beforeDestroy() { }, //生命周期 - 销毁之前
  destroyed() { }, //生命周期 - 销毁完成
  activated() { } //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped lang="stylus">
@import '../domesticconsumer.styl';
</style>
